package com.example.xdzx.service;

import com.example.xdzx.mapper.UserMapper;
import com.example.xdzx.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class UserService {
    @Autowired
    UserMapper userMapper;

    /**
     * 根据用户ID获取用户
     * @param userId
     * @return
     */
    public User getUserById(Long userId){
        return userMapper.getUserById(userId);
    };
}
